<?php

namespace App\Http\Controllers\api;

use App\Http\Controllers\Controller;
use App\Models\news;
use App\Services\Token;
use Illuminate\Http\Request;

class NewsController extends Controller
{
    //
    public function news(Request $request)
    {
        $token = $request['token'];
        $id = (new Token())->chekToken($token);
       $data =  news::where('user_id',$id['user_id'])->get()->toarray();
       return json_encode(['code'=>200,'msg'=>'ok','data'=>$data]);
    }
}
